import java.util.Scanner;

public class fengexianglian {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        Long[] b=new Long[a];
        int n=0,w=0;
        for (int i = 0; i < a; i++) {
            b[i]=in.nextLong();
        }
        for (int i = 1; i <b.length-1; i++) {
            for (int j = 1; j <b.length; j++) {
                if(b[j-1]>b[j]){
                    Long v=b[j];
                    b[j]=b[j-1];
                    b[j-1]=v;
                }
            }
        }
        for (int i = 0,j=b.length-1; i <j ; i++,j--) {
            if(n==w){
                n=(int)(n+b[i]);
            }
            if(n>w){
                w=(int)(w+b[i]+b[j]);
            }
            if(n<w){
                n=(int)(n+b[i]+b[j]);
            }
        }
        if(n>w)
            System.out.println(w/2);
        else
            System.out.println(n/2);
    }
}
